USE master; 
GO 
  
--Drop Database if it exists
DROP DATABASE IF EXISTS ReportDB; 
GO 
  
--Drop the database and close connections to it 
BEGIN TRY 
   ALTER DATABASE ReportDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE 
   DROP DATABASE IF EXISTS ReportDB 
   PRINT 'DATABASE ReportDB dropped!' 
END TRY 
BEGIN CATCH 
   PRINT 'DATABASE ReportDB not available to drop' 
END CATCH; 
GO 
  
-- Create the Database 
CREATE DATABASE ReportDB; 
GO 
  
USE ReportDB; 
GO 